package com.yuxi.modelExt;

import com.yuxi.common.NumberUtil;
import com.yuxi.common.StringUtil;
import com.yuxi.enums.ProductTypeTypeFlagEnum;
import com.yuxi.modelDesc.ProductTypeDesc;
import lombok.Data;


/**
 * @author sunke
 * @Date 2023-10-13 10:05:04
 * @description ProductTypeExt      产品分类
 */
@Data
public class ProductTypeExt extends ProductTypeDesc {


    private String url;


    public String getUrl() {
        String url = "/product_list/";
        if (NumberUtil.parseInt(getTypeFlag()) == ProductTypeTypeFlagEnum.BRAND.getType().intValue()) {
            url = "/agency_list/";
        }

        if (StringUtil.isNotObjEmpty(getUpId())) {
            return url + getUpId() + "/" + getId() + ".html";
        }
        return url + getId() + ".html";

    }
}

